//
//  GZAZJOrderDetailModel.swift
//  GZAZJ
//
//  Created by Jason on 2017/5/17.
//  Copyright © 2017年 Jason. All rights reserved.
//

import Foundation

public struct GZAZJOrderDetailModel{
    
    /// 详细地址
    var address : String!
    /// 签约前合同存放地址
    var agreementUrl : String!
    /// 是否申请开发票0：否1：是
    var applyInvoice : Bool!
    /// 申请时间
    var applyTime : Int!
    /// 审核时间
    var approvalTime : Int!
    /// 区域
    var area : String!
    /// 还机到期时间
    var backTime : Int!
    /// 账期格式 3/12-一共12期当前第3期
    var bill : String!
    /// 碎屏险金额
    var brokenScreenAmount : Double!
    /// 是否购买碎屏险，false 否,true 是
    var brokenScreenBuyed : Bool!
    /// 买断时间
    var buyOutTime : Int!
    /// 买断金额
    var buyoutAmount : Double!
    /// 身份证反面地址
    var cardBackUrl : String!
    /// 身份证正面地址
    var cardFaceUrl : String!
    /// 下单渠道
    var channelNo : String!
    /// 用户下载渠道
    var channelType : String!
    /// 城市
    var city : String!
    /// 优惠券ID
    var couponId : String!
    /// 优惠券金额
    var couponAmount : String!
    /// 订单创建时间
    var createOn : Int!
    var creditState : Int!
    /// 折扣
    var discountFee : Double!
    /// 学历
    var education : Int!
    /// 身份证有效日期结束时间 2017-12-10
    var effectiveEndDate : String!
    /// 身份证有效日期开始时间 2017-12-10
    var effectiveStartDate : String!
    /// 紧急联系人
    var emergencyContact : String!
    /// 紧急联系电话
    var emergencyContactPhone : String!
    /// 电子签章存根号
    var evid : String!
    /// 扩展表ID（前端不用管）
    var extendId : Int!
    /// 人脸识别认证照片url地址
    var faceAuthUrl : String!
    /// 溢价金
    var floatAmount : Double!
    /// 主键ID（前端不用管）
    var id : Int!
    /// 身份证号
    var idNo : String!
    /// 手机IMEI
    var imei : String!
    /// 是否已经开票0：否1：是
    var invoiceEnd : Bool!
    /// 签发机关
    var issuingAuthority : String!
    /// 月租金
    var leaseAmount : Double!
    /// 产品租期（月）
    var leaseTerm : Int!
    /// 还机时候填写物流单号
    var logisticsNo : String!
    /// 物料品牌id
    var materielBrandId : Int!
    /// 物料品牌名称
    var materielBrandName : String!
    /// 物料分类id
    var materielClassId : Int!
    /// 物料分类名称
    var materielClassName : String!
    /// 物料型号id
    var materielModelId : Int!
    /// 物料型号名称
    var materielModelName : String!
    /// 物料编号
    var materielNo : String!
    /// 物料规格名称
    var materielSpecName : String!
    /// 物料名称
    var matreielName : String!
    /// 支付时间
    var payTime : Int!
    /// 手机号码
    var phoneNum : String!
    /// 产品一次性保险费（碎屏保障金）
    var premium : Double!
    /// 产品ID
    var productId : Int!
    /// 产品编号
    var productNo : String!
    /// 商品状态描述
    var productStateDesc : String!
    /// 产品类型（1：租赁；2:以租代购；3：出售）
    var productType : Int!
    /// 省份
    var prov : String!
    /// 真实姓名
    var realName : String!
    /// 实名认证状态 0-未认证 1-已认证
    var realnameCertState : Bool!
    /// 签收时间
    var receivedTime : Int!
    /// 归还提交时间
    var recycleTime : Int!
    /// 紧急联系人关系（0配偶 1亲属 2朋友）
    var relationship : Int!
    /// 订单编号
    var rentRecordNo : String!
    /// 户籍地址
    var residenceAddress : String!
    /// 还机时候填写物流单号
    var returnLogisticsNo : String!
    /// 签约盖章之后的合同地址
    var sealAgreementUrl : String!
    /// 发货时间
    var sendOutTime : Int!
    /// 芝麻信用
    var sesameCredit : Double!
    /// 已缴纳滞纳金
    var settledLateFees : Double!
    /// 已还租金
    var settledRent : Double!
    /// 显示价值
    var showAmount : Double!
    /// 产品签约价值
    var signContractAmount : Double!
    /// 电子签章存根号
    var signServiceId : String!
    /// 确认签约时间
    var signTime : Int!
    /// 手机sn编码
    var snCode : String!
    /// 起租时间
    var startRentTime : Int!
    /// 状态码
    var state : Int!
    /// 对应状态按钮描述
    var stateDesc : String!
    /// 库存状态：0无货、1有货、2未更新库存
    var stockFlag : Int!
    /// 提前解约申请时间
    var terminateApplyTime : Int!
    /// 产品缩率图
    var thumbnail : String!
    /// 状态对应提示语
    var tipInfo : String!
    /// 订单更新时间
    var updateOn : Int!
    /// 用户编号
    var userId : Int!
    /// 订单待支付超时自动取消时间
    var waitPayTime : Int!
    /// 新旧程度配置id
    var materielNewConfigId : Int!
    /// 新旧程度配置值
    var configValue : String!
    /// 信用通道需支付租金总额（未减去优惠券金额的）
    var waitPayAmount : Double!
    /// 售卖订单总支付价格
    var salePayAmount : Double!
    /// 1:app, 2:芝麻小程序, 3:京东, 4:线下门店
    var inputChannelType : Int!
    /// 押金金额
    var lastDepositAmout : Double!
    /// 押金来源描述
    var depositSourceDesc : String!
    /// 信用租赁押金金额
    var creditDeposit : Double!
    /// 快捷通道押金金额
    var fastDeposit : Double!
    /// 信用卡租期
    var creditLeaseTerm : Int!
    /// 信用卡月租金
    var creditLeaseAmount : Double!
    /// 租赁方式： 1免押租赁（信用审核） 2付押租赁(快捷通道)
    var rentType : Int!
    /// 押金来源： 1花呗 2信用卡 3储蓄卡
    var depositSource : Int!
    /// 商户编码
    var storeNo: String!
    /// 门店id
    var storeId: Int!
    /// 订单类型 0:app, 1:线下门店
    var orderType: Int!
    /// 订单来源 1:APP, 2:小程序
    var orderSource: Int!
    /// 专区编码
    var zoneCode : String!
    /// 合作模式{"有货":"1 走门店下单流程","无货":"0 走app下单流程"}
    var cooperationMode : Int!
    /// 套餐
    var mealName : String!
    /// 全部规格(2.1)
    var newMaterielSpecName : String!
    /// 总租金
    var totalLeaseAmount : Double!
    /// 快捷通道需支付租金总额（未减去优惠券金额的）
    var waitFastPayAmount : Double!
    
    /**
     * Instantiate the instance using the passed dictionary values to set the properties values
     */
    public init(fromDictionary dictionary: [String:Any]){
        address = dictionary["address"] as? String
        agreementUrl = dictionary["agreementUrl"] as? String
        applyInvoice = dictionary["applyInvoice"] as? Bool
        applyTime = dictionary["applyTime"] as? Int
        approvalTime = dictionary["approvalTime"] as? Int
        area = dictionary["area"] as? String
        backTime = dictionary["backTime"] as? Int
        bill = dictionary["bill"] as? String
        brokenScreenAmount = dictionary["brokenScreenAmount"] as? Double
        brokenScreenBuyed = dictionary["brokenScreenBuyed"] as? Bool
        buyOutTime = dictionary["buyOutTime"] as? Int
        buyoutAmount = dictionary["buyoutAmount"] as? Double
        cardBackUrl = dictionary["cardBackUrl"] as? String
        cardFaceUrl = dictionary["cardFaceUrl"] as? String
        channelNo = dictionary["channelNo"] as? String
        channelType = dictionary["channelType"] as? String
        city = dictionary["city"] as? String
        couponId = dictionary["couponId"] as? String
        couponAmount = dictionary["couponAmount"] as? String
        createOn = dictionary["createOn"] as? Int
        creditState = dictionary["creditState"] as? Int
        discountFee = dictionary["discountFee"] as? Double
        education = dictionary["education"] as? Int
        effectiveEndDate = dictionary["effectiveEndDate"] as? String
        effectiveStartDate = dictionary["effectiveStartDate"] as? String
        emergencyContact = dictionary["emergencyContact"] as? String
        emergencyContactPhone = dictionary["emergencyContactPhone"] as? String
        evid = dictionary["evid"] as? String
        extendId = dictionary["extendId"] as? Int
        faceAuthUrl = dictionary["faceAuthUrl"] as? String
        floatAmount = dictionary["floatAmount"] as? Double
        id = dictionary["id"] as? Int
        idNo = dictionary["idNo"] as? String
        imei = dictionary["imei"] as? String
        invoiceEnd = dictionary["invoiceEnd"] as? Bool
        issuingAuthority = dictionary["issuingAuthority"] as? String
        leaseAmount = dictionary["leaseAmount"] as? Double
        leaseTerm = dictionary["leaseTerm"] as? Int
        logisticsNo = dictionary["logisticsNo"] as? String
        materielBrandId = dictionary["materielBrandId"] as? Int
        materielBrandName = dictionary["materielBrandName"] as? String
        materielClassId = dictionary["materielClassId"] as? Int
        materielClassName = dictionary["materielClassName"] as? String
        materielModelId = dictionary["materielModelId"] as? Int
        materielModelName = dictionary["materielModelName"] as? String
        materielNo = dictionary["materielNo"] as? String
        materielSpecName = dictionary["materielSpecName"] as? String
        matreielName = dictionary["matreielName"] as? String
        payTime = dictionary["payTime"] as? Int
        phoneNum = dictionary["phoneNum"] as? String
        premium = dictionary["premium"] as? Double
        productId = dictionary["productId"] as? Int
        productNo = dictionary["productNo"] as? String
        productStateDesc = dictionary["productStateDesc"] as? String
        productType = dictionary["productType"] as? Int
        prov = dictionary["prov"] as? String
        realName = dictionary["realName"] as? String
        realnameCertState = dictionary["realnameCertState"] as? Bool
        receivedTime = dictionary["receivedTime"] as? Int
        recycleTime = dictionary["recycleTime"] as? Int
        relationship = dictionary["relationship"] as? Int
        rentRecordNo = dictionary["rentRecordNo"] as? String
        residenceAddress = dictionary["residenceAddress"] as? String
        returnLogisticsNo = dictionary["returnLogisticsNo"] as? String
        sealAgreementUrl = dictionary["sealAgreementUrl"] as? String
        sendOutTime = dictionary["sendOutTime"] as? Int
        sesameCredit = dictionary["sesameCredit"] as? Double
        settledLateFees = dictionary["settledLateFees"] as? Double
        settledRent = dictionary["settledRent"] as? Double
        showAmount = dictionary["showAmount"] as? Double
        signContractAmount = dictionary["signContractAmount"] as? Double
        signServiceId = dictionary["signServiceId"] as? String
        signTime = dictionary["signTime"] as? Int
        snCode = dictionary["snCode"] as? String
        startRentTime = dictionary["startRentTime"] as? Int
        state = dictionary["state"] as? Int
        stateDesc = dictionary["stateDesc"] as? String
        stockFlag = dictionary["stockFlag"] as? Int
        terminateApplyTime = dictionary["terminateApplyTime"] as? Int
        thumbnail = dictionary["thumbnail"] as? String
        tipInfo = dictionary["tipInfo"] as? String
        updateOn = dictionary["updateOn"] as? Int
        userId = dictionary["userId"] as? Int
        waitPayTime = dictionary["waitPayTime"] as? Int
        materielNewConfigId = dictionary["materielNewConfigId"] as? Int
        configValue = dictionary["configValue"] as? String
        waitPayAmount = dictionary["waitPayAmount"] as? Double
        salePayAmount = dictionary["salePayAmount"] as? Double
        inputChannelType = dictionary["inputChannelType"] as? Int
        lastDepositAmout = dictionary["lastDepositAmout"] as? Double
        depositSourceDesc = dictionary["depositSourceDesc"] as? String
        creditDeposit = dictionary["creditDeposit"] as? Double
        fastDeposit = dictionary["fastDeposit"] as? Double
        creditLeaseTerm = dictionary["creditLeaseTerm"] as? Int
        creditLeaseAmount = dictionary["creditLeaseAmount"] as? Double
        rentType = dictionary["rentType"] as? Int
        depositSource = dictionary["depositSource"] as? Int
        storeNo = dictionary["storeNo"] as? String
        storeId = dictionary["storeId"] as? Int
        orderType = dictionary["orderType"] as? Int
        orderSource = dictionary["orderSource"] as? Int
        
        zoneCode = dictionary["zoneCode"] as? String
        cooperationMode = dictionary["cooperationMode"] as? Int
        mealName = dictionary["mealName"] as? String
        newMaterielSpecName = dictionary["newMaterielSpecName"] as? String
        totalLeaseAmount = dictionary["totalLeaseAmount"] as? Double
        waitFastPayAmount = dictionary["waitFastPayAmount"] as? Double
        
    }
    
    /**
     * Returns all the available property values in the form of [String:Any] object where the key is the approperiate json key and the value is the value of the corresponding property
     */
    public func toDictionary() -> [String:Any]
    {
        var dictionary = [String:Any]()
        if address != nil{
            dictionary["address"] = address
        }
        if agreementUrl != nil{
            dictionary["agreementUrl"] = agreementUrl
        }
        if applyInvoice != nil{
            dictionary["applyInvoice"] = applyInvoice
        }
        if applyTime != nil{
            dictionary["applyTime"] = applyTime
        }
        if approvalTime != nil{
            dictionary["approvalTime"] = approvalTime
        }
        if area != nil{
            dictionary["area"] = area
        }
        if backTime != nil{
            dictionary["backTime"] = backTime
        }
        if bill != nil{
            dictionary["bill"] = bill
        }
        if brokenScreenAmount != nil{
            dictionary["brokenScreenAmount"] = brokenScreenAmount
        }
        if brokenScreenBuyed != nil{
            dictionary["brokenScreenBuyed"] = brokenScreenBuyed
        }
        if buyOutTime != nil{
            dictionary["buyOutTime"] = buyOutTime
        }
        if buyoutAmount != nil{
            dictionary["buyoutAmount"] = buyoutAmount
        }
        if cardBackUrl != nil{
            dictionary["cardBackUrl"] = cardBackUrl
        }
        if cardFaceUrl != nil{
            dictionary["cardFaceUrl"] = cardFaceUrl
        }
        if channelNo != nil{
            dictionary["channelNo"] = channelNo
        }
        if channelType != nil{
            dictionary["channelType"] = channelType
        }
        if city != nil{
            dictionary["city"] = city
        }
        if couponId != nil{
            dictionary["couponId"] = couponId
        }
        if couponAmount != nil{
            dictionary["couponAmount"] = couponAmount
        }
        if createOn != nil{
            dictionary["createOn"] = createOn
        }
        if creditState != nil{
            dictionary["creditState"] = creditState
        }
        if discountFee != nil{
            dictionary["discountFee"] = discountFee
        }
        if education != nil{
            dictionary["education"] = education
        }
        if effectiveEndDate != nil{
            dictionary["effectiveEndDate"] = effectiveEndDate
        }
        if effectiveStartDate != nil{
            dictionary["effectiveStartDate"] = effectiveStartDate
        }
        if emergencyContact != nil{
            dictionary["emergencyContact"] = emergencyContact
        }
        if emergencyContactPhone != nil{
            dictionary["emergencyContactPhone"] = emergencyContactPhone
        }
        if evid != nil{
            dictionary["evid"] = evid
        }
        if extendId != nil{
            dictionary["extendId"] = extendId
        }
        if faceAuthUrl != nil{
            dictionary["faceAuthUrl"] = faceAuthUrl
        }
        if floatAmount != nil{
            dictionary["floatAmount"] = floatAmount
        }
        if id != nil{
            dictionary["id"] = id
        }
        if idNo != nil{
            dictionary["idNo"] = idNo
        }
        if imei != nil{
            dictionary["imei"] = imei
        }
        if invoiceEnd != nil{
            dictionary["invoiceEnd"] = invoiceEnd
        }
        if issuingAuthority != nil{
            dictionary["issuingAuthority"] = issuingAuthority
        }
        if leaseAmount != nil{
            dictionary["leaseAmount"] = leaseAmount
        }
        if leaseTerm != nil{
            dictionary["leaseTerm"] = leaseTerm
        }
        if logisticsNo != nil{
            dictionary["logisticsNo"] = logisticsNo
        }
        if materielBrandId != nil{
            dictionary["materielBrandId"] = materielBrandId
        }
        if materielBrandName != nil{
            dictionary["materielBrandName"] = materielBrandName
        }
        if materielClassId != nil{
            dictionary["materielClassId"] = materielClassId
        }
        if materielClassName != nil{
            dictionary["materielClassName"] = materielClassName
        }
        if materielModelId != nil{
            dictionary["materielModelId"] = materielModelId
        }
        if materielModelName != nil{
            dictionary["materielModelName"] = materielModelName
        }
        if materielNo != nil{
            dictionary["materielNo"] = materielNo
        }
        if materielSpecName != nil{
            dictionary["materielSpecName"] = materielSpecName
        }
        if matreielName != nil{
            dictionary["matreielName"] = matreielName
        }
        if payTime != nil{
            dictionary["payTime"] = payTime
        }
        if phoneNum != nil{
            dictionary["phoneNum"] = phoneNum
        }
        if premium != nil{
            dictionary["premium"] = premium
        }
        if productId != nil{
            dictionary["productId"] = productId
        }
        if productNo != nil{
            dictionary["productNo"] = productNo
        }
        if productStateDesc != nil{
            dictionary["productStateDesc"] = productStateDesc
        }
        if productType != nil{
            dictionary["productType"] = productType
        }
        if prov != nil{
            dictionary["prov"] = prov
        }
        if realName != nil{
            dictionary["realName"] = realName
        }
        if realnameCertState != nil{
            dictionary["realnameCertState"] = realnameCertState
        }
        if receivedTime != nil{
            dictionary["receivedTime"] = receivedTime
        }
        if recycleTime != nil{
            dictionary["recycleTime"] = recycleTime
        }
        if relationship != nil{
            dictionary["relationship"] = relationship
        }
        if rentRecordNo != nil{
            dictionary["rentRecordNo"] = rentRecordNo
        }
        if residenceAddress != nil{
            dictionary["residenceAddress"] = residenceAddress
        }
        if returnLogisticsNo != nil{
            dictionary["returnLogisticsNo"] = returnLogisticsNo
        }
        if sealAgreementUrl != nil{
            dictionary["sealAgreementUrl"] = sealAgreementUrl
        }
        if sendOutTime != nil{
            dictionary["sendOutTime"] = sendOutTime
        }
        if sesameCredit != nil{
            dictionary["sesameCredit"] = sesameCredit
        }
        if settledLateFees != nil{
            dictionary["settledLateFees"] = settledLateFees
        }
        if settledRent != nil{
            dictionary["settledRent"] = settledRent
        }
        if showAmount != nil{
            dictionary["showAmount"] = showAmount
        }
        if signContractAmount != nil{
            dictionary["signContractAmount"] = signContractAmount
        }
        if signServiceId != nil{
            dictionary["signServiceId"] = signServiceId
        }
        if signTime != nil{
            dictionary["signTime"] = signTime
        }
        if snCode != nil{
            dictionary["snCode"] = snCode
        }
        if startRentTime != nil{
            dictionary["startRentTime"] = startRentTime
        }
        if state != nil{
            dictionary["state"] = state
        }
        if stateDesc != nil{
            dictionary["stateDesc"] = stateDesc
        }
        if stockFlag != nil{
            dictionary["stockFlag"] = stockFlag
        }
        if terminateApplyTime != nil{
            dictionary["terminateApplyTime"] = terminateApplyTime
        }
        if thumbnail != nil{
            dictionary["thumbnail"] = thumbnail
        }
        if tipInfo != nil{
            dictionary["tipInfo"] = tipInfo
        }
        if updateOn != nil{
            dictionary["updateOn"] = updateOn
        }
        if userId != nil{
            dictionary["userId"] = userId
        }
        if waitPayTime != nil{
            dictionary["waitPayTime"] = waitPayTime
        }
        if materielNewConfigId != nil{
            dictionary["materielNewConfigId"] = materielNewConfigId
        }
        if configValue != nil{
            dictionary["configValue"] = configValue
        }
        if waitPayAmount != nil{
            dictionary["waitPayAmount"] = waitPayAmount
        }
        if salePayAmount != nil{
            dictionary["salePayAmount"] = salePayAmount
        }
        if inputChannelType != nil{
            dictionary["inputChannelType"] = inputChannelType
        }
        if lastDepositAmout != nil{
            dictionary["lastDepositAmout"] = lastDepositAmout
        }
        if depositSourceDesc != nil{
            dictionary["depositSourceDesc"] = depositSourceDesc
        }
        if creditDeposit != nil{
            dictionary["creditDeposit"] = creditDeposit
        }
        if fastDeposit != nil{
            dictionary["fastDeposit"] = fastDeposit
        }
        if creditLeaseTerm != nil{
            dictionary["creditLeaseTerm"] = creditLeaseTerm
        }
        if creditLeaseAmount != nil{
            dictionary["creditLeaseAmount"] = creditLeaseAmount
        }
        if rentType != nil{
            dictionary["rentType"] = rentType
        }
        if depositSource != nil{
            dictionary["depositSource"] = depositSource
        }
        if storeNo != nil{
            dictionary["storeNo"] = storeNo
        }
        if storeId != nil{
            dictionary["storeId"] = storeId
        }
        if orderType != nil{
            dictionary["orderType"] = orderType
        }
        if orderSource != nil{
            dictionary["orderSource"] = orderSource
        }
        if zoneCode != nil{
            dictionary["zoneCode"] = zoneCode
        }
        if cooperationMode != nil{
            dictionary["cooperationMode"] = cooperationMode
        }
        if mealName != nil{
            dictionary["mealName"] = mealName
        }
        if newMaterielSpecName != nil{
            dictionary["newMaterielSpecName"] = newMaterielSpecName
        }
        if totalLeaseAmount != nil{
            dictionary["totalLeaseAmount"] = totalLeaseAmount
        }
        if waitFastPayAmount != nil{
            dictionary["waitFastPayAmount"] = waitFastPayAmount
        }
        return dictionary
    }
}
